package com.example.controller.impl;

import com.example.controller.AIController;

/**
 * @Auther: tong
 * @Date: 2023/01/19/21:02
 * @Description:
 */
public class AIControllerImpl implements AIController {
    @Override
    public String getAnswer(String question) {
        String str = question.replace("吗", "");
        str = str.replace("？", "！");
        str = str.replace("?", "!");
        return str;
    }

    @Override
    public String fortuneTelling(String name) {
        // AI核心代码
        String[] strs = {"女犯伤官把夫克，早地莲花栽不活，不是吃上两家饭，也要刷上三家锅。",
                "一朵鲜花头上戴，一年四季也不开，一心想要花开时，采花之人没到来。",
                "此命生来脾气暴，上来一阵双脚跳，对你脾气啥都好，经常与人吵和闹。"};
        int index=name.hashCode()%3;
        return strs[index];
    }
}
